<template>
  <div class="wrapper" @click="update">

    <image style="width: 180px; height:180px; align-self:center; margin:30px;"
      :src="getFullImagePath('zwl.png')"
      ></image>

    <text style="font-size:40px; font-weight:bold; align-self:center;">曾威林</text>

    <text style="font-size:25px; font-weight:bold; align-self:center; margin-bottom:20px; margin-top:20px;">求职意向：iOS开发</text>

    <rightHeader
      title="基本信息"
      >
      <text class="normalText" v-for="data in baseInfo">{{data}}</text>
    </rightHeader>


    <rightHeader
      title="联系方式"
      >

        <div style="flex-direction:row; align-items:center;"
          @click="dialPhoneAction">
          <text class="normalText">手机:</text>
          <text class="underLineNormalText">{{contractInfo.phone}}</text>
        </div>

        <div style="flex-direction:row; align-items:center;"
          @click="sendMailAction"
          >
          <text class="normalText">邮箱:</text>
          <text class="underLineNormalText">{{contractInfo.email}}</text>
        </div>


    </rightHeader>



    <rightHeader
      title="专业技能"
      >
      <skill class="skill"
        v-for="data in skilsDatas"
        :thumbName="data.thumbName"
        :name="data.name"
        :rate="data.rate"
        key="sdf"
      ></skill>
    </rightHeader>

    <rightHeader
      title="外语能力"
      >
      <text class="normalText" v-for="data in otherInfo">{{data}}</text>
    </rightHeader>

  </div>
</template>

<style scoped>
  .wrapper { padding-bottom: 100px;}
  .logo { width: 360px; height: 82px; margin: 80px; align-self: center;}
  .skill { margin: 10px; margin-right: 40px;}
  .normalText { font-size: 24px; color: #000000; margin-left: 8px;margin-top: 15px; }
  .underLineNormalText { font-size: 24px; color: #000000; text-decoration: underline;margin-top: 15px;}
</style>

<script>

  export default {
    components: {
      skill:require('./views/skill.vue'),
      rightHeader: require('./views/rightHeaderView.vue')
    },

    data: function () {
      return {
        //基本信息
        baseInfo: [
          '性别：男',
          '本科      湘潭大学',
          '籍贯：湖南长沙',
          '出生日期：1991.08'
        ],

        //联系方式
        contractInfo: {
          phone:'17673047363',
          email:'zwlxtu@163.com'

        },

        //专业技能
        skilsDatas: [
          {
            thumbName: 'OC',
            name: 'Objective-C',
            rate: 0.8
          },{
            thumbName: 'Java',
            name: 'Java & Android',
            rate: 0.7
          },{
            thumbName: 'JS',
            name: 'Java script',
            rate: 0.5
          },{
            thumbName: 'WX',
            name: 'Weex',
            rate:  0.5
          },{
            thumbName: 'RN',
            name: 'React Native',
            rate: 0.5
          }
        ],

        //其他
        otherInfo: [
          '⭐️ 英语四级'
        ]
      }

    },
    methods: {
      update: function (e) {
        this.target = 'Weex'
        console.log('target:', this.target)
      },
      dialPhoneAction: function () {
        if (weex.config.env.platform == 'iOS') {
          const event = weex.requireModule('event');
          event.dialPhoneAction(this.contractInfo.phone);
        } else if (weex.config.env.platform == 'Web') {
          console.log('web上');
          window.location.href = "tel:"+this.contractInfo.phone;
        }
      },
      sendMailAction: function () {
        if (weex.config.env.platform == 'iOS') {
          const event = weex.requireModule('event');
          event.sendMailAction(this.contractInfo.email);

        } else if (weex.config.env.platform == 'Web') {
          console.log('web上');
          window.location.href = "mailto:" + this.contractInfo.email;

        }

      }
    }
  }
</script>
